/**
 * 全局错误处理，防止 node 中断
 *
 * @author Zeon scplay@gmail.com
 * @date 2018/9/26
 * @copyright Created by Panxsoft.
 */

const log4js = require('./log4js');

const { severEndLogger } = log4js;

process.on('uncaughtException', (err) => {
	severEndLogger.error(err.message);
	console.error(err.stack);
	const time = new Date().toString();
	console.log(`${time} uncaught exception ...`);
});
